﻿#include"stdafx.h"
#ifdef LK_WINDOWS_UI_WINDOW_
namespace LK
{
	namespace Windows
	{
		namespace UI
		{
			WNDCLASSEXW& IWindow::Design()
			{
				static ATOM atom;
				static WNDCLASSEXW wndclass;
				if (!atom){
					wndclass.cbSize = sizeof(WNDCLASSEXW);
					wndclass.style = CS_HREDRAW | CS_VREDRAW;
					wndclass.lpfnWndProc = StaticWndProc;
					wndclass.cbClsExtra = 0;
					wndclass.cbWndExtra = 0;
					wndclass.hInstance = GetCurrentInstance();
					wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
					wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
					wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
					wndclass.lpszMenuName = NULL;
					wndclass.lpszClassName = L"IWindow";
					wndclass.hIconSm = NULL;
					atom = RegisterClassExW(&wndclass);
				}
				return wndclass;
			}
			LRESULT IWindow::DefWndProc(MSG& message)
			{
				if (message.message == WM_DESTROY)PostQuitMessage(0);
				return DefWindowProcW(message.hwnd, message.message, message.wParam, message.lParam);//默认的处理方式
			}
		}
	}
}
#endif